<template>
    <div>
        <!-- 用户管理 -->
        <Add ></Add>
        <List :data="users" :pagination="pagination" @show="show"></List>
        <Pagination :pagination="pagination" @show="show"></Pagination>
        <UserToRole></UserToRole>
        <UserToFunction></UserToFunction>
    </div>
</template>
<script setup>
import { listUser } from '../../services/user';
import Add from './modules/Add.vue';
import List from './modules/List.vue';
import Pagination from '../../components/Pagination.vue';
import UserToRole from './modules/UserToRole.vue';
import UserToFunction from './modules/UserToFunction.vue';
import {onMounted, ref} from 'vue';
const users = ref([]);
const pagination = ref({});

async function show(current = 1,pageSize = 5){
    let res = await listUser(current,pageSize);
    
    users.value = res.data.list;
    pagination.value = res.data;
    console.log(users.value);
}
onMounted(() => {
    show();
})
</script>